home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASDEMO2 / GRAPHT2.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  711b  |  23 lines

  1. program GraphTest2;
  2. uses
  3.    Graph;
  4. var
  5.    GraphDriver,
  6.    GraphMode,
  7.    ErrorCode: integer;
  8. begin
  9.    GraphDriver := Detect;   { Set flag: do detection }
  10.    InitGraph( GraphDriver, GraphMode, 'C:\DRIVERS' );
  11.    ErrorCode := GraphResult;
  12.    if ErrorCode <> GrOK then begin  { Error? }
  13.       writeln( 'Graphics error: ', GraphErrorMsg( ErrorCode ) );
  14.       writeln( 'Program aborted...' );
  15.       Halt( 1 );
  16.    end;
  17.    OutText( 'In Graphics mode. Press <RETURN>' ); readln;
  18.    RestoreCRTMode;
  19.    write( 'Now in text mode. Press <RETURN>' ); readln;
  20.    SetGraphMode( GraphMode );
  21.    OutText( 'Back in Graphics mode. Press <RETURN>' ); readln;
  22.    CloseGraph;
  23. end.   { end of program GraphTest }